package demo2;

public class CounterUse {
    static class Counter {
        public int count = 0;
        synchronized void increase() {
            count++;
        }
        synchronized void increase2() {
            increase();
        }
    }

    public static void main(String[] args) {
        Counter counter = new Counter();
        counter.increase();
        counter.increase2();
        System.out.println(counter.count);
    }
}
